/*
* introduction: This code is to load LisP library.
* thanks-to https://github.com/maryrosecook/littlelisp
*
* author ufo
* email ufo5260987423@163.com
* date 28 March 2014 
*
* quality Firefox 28.0 +ubuntu 12.04 accept
*/
function initRepl(){
	var loadLispLibrary=coreLibrary;
	if(''!=loadLispLibrary){
		var library=divSentence(loadLispLibrary.split(''));
		for(var tmp =library.pop();tmp;tmp=library.pop() )
			interpretList(parse(tmp));
	}
}
function divSentence(target){
	target=target.reverse();
	var result=new Array();
	var tmp='';
	var counter=0;
	for(var tmpChar=target.pop();tmpChar;tmpChar=target.pop()){
		if(tmpChar=='(')
			counter++;
		else
			if(tmpChar==')')
				counter--;
		tmp+=tmpChar;
		if(tmp!='' && 0==counter){
			result.push(tmp);
			tmp='';
		}
	}
	return result;
}
